package com.lei.zjs.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.lei.zjs.dao.UserDao;
import com.lei.zjs.dao.base.BaseDaoImpl;
import com.lei.zjs.vo.User;

@Repository
public class UserDaoImpl extends BaseDaoImpl<User> implements UserDao {

	@Override
	public User findUserByUsername(String username) {
		String hql = "from User u where u.username = ?";
		List<User> list = this.getHibernateTemplate().find(hql, username);
		if (list != null && list.size() > 0) {
			return list.get(0);
		}
		return null;
	}

}
